using System;
using System.Web.UI;
using anrControls.SyntaxColoring;
using SharpPieces.Web.Controls;

namespace SharpPieces.DemoApp
{

    public partial class RuntimeCode : Page
    {
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!this.IsPostBack)
            {
                this.DropDownList1.DataSource = Enum.GetNames(typeof(CodeSyntax));
                this.DropDownList1.DataBind();
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(this.TextBox1.Text))
            {
                string html = CodeHighlighterFactory.GetHighlighter((CodeSyntax)Enum.Parse(typeof(CodeSyntax), this.DropDownList1.SelectedItem.Text))
                    .ColorCode(this.TextBox1.Text);
                this.TextBox2.Text = html;
            }
        }

        public void aaa()
        {
            GradientButton GradientButton1 = new GradientButton();
            GradientButton1.Click += new EventHandler(GradientButton1_Click);
        }

        void GradientButton1_Click(object sender, EventArgs e)
        {
            throw new Exception("The method or operation is not implemented.");
        }
    }

}
